From 99a0431ec98ad31cbcea034c8e5c2d6dabc11f04 Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Mon, 9 Aug 2004 10:20:37 +0000 Subject: [PATCH] bitkeeper revision 1.1159.1.16 (41174ff5ujN698k09JTEc1zTtLVakg) Fix initrd for 2.6. --- .../arch/xen/i386/kernel/head.S | 26 ------------------- .../arch/xen/i386/kernel/setup.c | 8 +++--- .../include/asm-xen/asm-i386/setup.h | 2 +- 3 files changed, 5 insertions(+), 31 deletions(-) diff --git a/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/head.S b/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/head.S index 688d6e18e7..254038000e 100644 --- a/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/head.S +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/head.S @@ -24,38 +24,12 @@ #define X86_CAPABILITY new_cpu_data+CPUINFO_x86_capability #define X86_VENDOR_ID new_cpu_data+CPUINFO_x86_vendor_id -/* Offsets in start_info structure */ -#define MOD_START 24 -#define MOD_LEN 28 - ENTRY(startup_32) cld /* Set up the stack pointer */ lss stack_start,%esp - /* Copy initrd somewhere safe before it's clobbered by BSS. */ - mov MOD_LEN(%esi),%ecx - shr $2,%ecx - jz 2f /* bail from copy loop if no initrd */ - mov $_end,%edi - add MOD_LEN(%esi),%edi - mov MOD_START(%esi),%eax - add MOD_LEN(%esi),%eax -1: sub $4,%eax - sub $4,%edi - mov (%eax),%ebx - mov %ebx,(%edi) - loop 1b - mov %edi,MOD_START(%esi) - - /* Clear BSS first so that there are no surprises... */ -2: xorl %eax,%eax - movl $__bss_start,%edi - movl $__bss_stop,%ecx - subl %edi,%ecx - rep stosb - /* Copy the necessary stuff from start_info structure. */ mov $start_info_union,%edi mov $128,%ecx diff --git a/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/setup.c b/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/setup.c index dbc4fbdb9a..c3a3de1337 100644 --- a/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/setup.c +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/setup.c @@ -894,12 +894,12 @@ static unsigned long __init setup_memory(void) #endif #ifdef CONFIG_BLK_DEV_INITRD - if (LOADER_TYPE && INITRD_START) { + if (start_info.mod_start) { if (INITRD_START + INITRD_SIZE <= (max_low_pfn << PAGE_SHIFT)) { - reserve_bootmem(INITRD_START, INITRD_SIZE); - initrd_start = - INITRD_START ? INITRD_START + PAGE_OFFSET : 0; + /*reserve_bootmem(INITRD_START, INITRD_SIZE);*/ + initrd_start = INITRD_START + PAGE_OFFSET; initrd_end = initrd_start+INITRD_SIZE; + initrd_below_start_ok = 1; } else { printk(KERN_ERR "initrd extends beyond end of memory " diff --git a/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/setup.h b/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/setup.h index 3b92f29eab..5d7513a392 100644 --- a/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/setup.h +++ b/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/setup.h @@ -53,7 +53,7 @@ extern unsigned char boot_params[PARAM_SIZE]; #define AUX_DEVICE_INFO (*(unsigned char *) (PARAM+0x1FF)) #define LOADER_TYPE (*(unsigned char *) (PARAM+0x210)) #define KERNEL_START (*(unsigned long *) (PARAM+0x214)) -#define INITRD_START (start_info.mod_start) +#define INITRD_START (__pa(start_info.mod_start)) #define INITRD_SIZE (start_info.mod_len) #define EDID_INFO (*(struct edid_info *) (PARAM+0x440)) #define DISK80_SIGNATURE (*(unsigned int*) (PARAM+DISK80_SIG_BUFFER)) -- 2.30.2